package com.xinghou.platform.util;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class ArrayListUtil {

	public static <T> ArrayList<T> sortList(List<T> data){
		
		Collections.sort(data, new Comparator<T>() {
            public int compare(T arg0, T arg1) {
                return arg0.toString().compareTo(arg1.toString());
            }
        });
		
		return (ArrayList<T>) data;
		
	}
	
	public static void main(String[] args) {
		String[] aa = {};
		String[] bb = new String[2];
		bb[0] = "ss";
		bb[1] = "dd";
		
		aa = bb;
		
		System.out.println(aa.length);
		
		Timestamp date = new Timestamp(System.currentTimeMillis());
		System.out.println(DateUtils.getNewZhCNDateTime(date));
		
		String date1 = "20150925090909";

//		int month = Integer.parseInt(mm);
//		int day = Integer.parseInt(dd);
//		if (month < 1 || month > 12 || day < 1 || day > 31)
//			throw new Exception("日期格式错误");

		StringBuffer str = new StringBuffer();
		str.append(date1.substring(0, 4));
		str.append("-");
		str.append(date1.substring(4, 6));
		str.append("-");
		str.append(date1.substring(6, 8));
		str.append(" ");
		str.append(date1.substring(8, 10));
		str.append(":");
		str.append(date1.substring(10, 12));
		str.append(":");
		str.append(date1.substring(12, 14));
//		/return getDate(str, DATEFORMAT_STR);

		System.out.println(new Timestamp(DateUtils.getDate(str.toString()).getTime()));
	}



}
